package org.gpp.proj1.robot.part;

/**
 * Enumeration for robot part types
 * 
 * @author Paolo Victor, paolovictor@gmail.com
 */
public enum PartType {
	HEAD( "head" ),
	TORSO( "torso" ),
	BACKPACK( "backpack" ),
	LEGS( "legs" ),
	ARM( "arm" );
	
	private String name;
	
	private PartType( String name ) {
		this.name = name;
	}
	
	public String getName() {
		return this.name;
	}
	
	public static PartType getType( String name ) {
		PartType[] types = values();
		for( PartType type : types ) {
			if( type.getName().equals( name ) ) {
				return type;
			}
		}
		return null;
	}
}
